<?php
define('FPDF_FONTPATH','font');
require_once('lib/fpdf.php');
require_once('lib/fpdi.php');

// initiate FPDI
$pdf = new FPDI();
//$pdf->DefPageSize=$pdf->StdPageSizes['a4'];
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('template/f24.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx);
$pdf->AddFont('courier','','courier.php'); 
// now write some text above the imported page
$pdf->SetFont('courier','',12);
$pdf->SetTextColor(0,0,0);
// La posizione è in mm !!
$pdf->Text(41,41, "S C L R M R 7 1 B 2 0 G 1 4 9 S");

$pdf->SetFont('courier','',9);
$pdf->Text(8,185,"G 1 4 9");
$pdf->SetFont('courier','',10);
$pdf->Text(37,185,"X");
$pdf->Text(48,185,"1");
$pdf->Text(63,185,"1234");
$pdf->Text(100,185,"2012");
$pdf->Text(130.5,185,"32 50");
$pdf->Text(163.5,185,"0 00");

$pdf->Output('newpdf.pdf', 'D');

?>